@extends('layouts.app')

@section('title','SunPictureList')

@section('content')
  <div class="container">
        <div class="row">
            <div class="col-md-12">

              <header class="list-header">
                    <section>晒图列表</section>
              </header>

              <table class="table table-hover table-striped list-table">
                            <tr class="list-table-tr">
                                <th>帖子内容</th>
                                <th>帖子图片</th>
                                <th>评论数量</th>
                                <th>评论分类</th>
                                <th class="text-right">Operation</th>
                            </tr>

                            @foreach($sunPicture as $v)
                                <tr>
                                    <td>{{ $v->posts_content }}</td>
                                    <td> <img src="/uploads/avatars/{{ $v->posts_pic}}" width="50px"/></td>
                                    <td>{{ $v->comments_count }}</td>
                                    <td>
                                        @if($v->level == 0)
                                            <span>关注俱乐部</span>
                                        @elseif($v->level==1)
                                            <span>帝意射箭中心</span>
                                        @elseif($v->level == 2)
                                            <span>瑜伽会馆</span>
                                        @endif
                                    </td>
                                    <td class="text-right">
                                        <a  href="{{ URL('admin/sunPicture/'.$v->id.'/edit') }}" class="edit">
                                            <i class="fa fa-pencil-square-o fa-lg" aria-hidden="true"></i>
                                        </a>

                                        <form action="{{ URL('admin/sunPicture/'.$v->id) }}" method="POST" style="display: inline;">
                                            <input name="_method" type="hidden" value="DELETE">
                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                            <button type="submit" class="delete"><i class="fa fa-trash-o fa-lg" aria-hidden="true"></i></button>
                                        </form>
                                    </td>

                                </tr>
                            @endforeach
                        </table>
                        <hr>
                        {!! $sunPicture->render() !!}

           </div>
        </div>
    </div>
@endsection